import os


def check_py_pep8(path=os.path.abspath("."), filter_file_type=".py") -> list:
    """递归，过滤符合条件的文件"""
    py_list = []
    for a in os.listdir(path):
        file_path = "{}/{}".format(path, a)
        if os.path.isfile(file_path):
            if file_path.endswith(filter_file_type):
                py_list.append(file_path)
        elif os.path.isdir(file_path):
            py_list.extend(check_py_pep8(file_path))
    return py_list
